package jee.boot.entity.system;

import jee.boot.common.annotation.Column;
import jee.boot.common.annotation.Table;

/**
 * 树模型
 */
@Table(name = "st_tree_model")
public class TreeModel extends GeneralDataEntity<TreeModel> {
    private static final long serialVersionUID = 1L;

    /**
     * 模型
     */
    @Column(name = "st_model")
    private String model;//模型
    /**
     * 父ID
     */
    @Column(name = "st_parent_id", data = {"parent.id", "parent.no", "parent.code", "parent.name", "parent.desc", "parent.type"})
    private TreeModel parent;//引用：ST_TREE_MODEL，非必填，在TreeNode挂载时按此字段设定要求当前Model的对象只能挂载到父“树模型”的下级，此字段为空则代表可以挂载在任意父节点下或自己就是根节点
    /**
     * 树ID
     */
    @Column(name = "st_tree_id", data = {"treeDefinition.id", "treeDefinition.no", "treeDefinition.code", "treeDefinition.name", "treeDefinition.desc", "treeDefinition.type"})
    private TreeDefinition treeDefinition;//引用：ST_TREE，冗余存储(原本根据ST_TREE_MODEL_ID可以间接推断出来)
    /**
     * 树节点层级
     */
    @Column(name = "n_tree_node_tier")
    private Integer treeNodeTier;//整型，非必填，在TreeNode挂载时按此字段设定要求当前Model的对象只能挂载到树的对应层级上，此字段为空时则代表可以挂载在任意层级上
    /**
     * 数据接口(requestUrl)
     */
    @Column(name="st_url")
    private String url;// 当前树模型的数据接口,用于前端查询该模型的实体数据 比如: /auth/user/list
    /**
     * 适配一个表模式的树表结构在配置树权限时候的冗余存储
     */
    @Column(name="st_tree_table_name")
    private String treeTableName;
    /**
     *  模型类别: tree_model_category_01:通用树模型; tree_model_category_02:单表树模型
     */
    @Column(name="st_model_category")
    private String modelCategory;
    /**
     * 数据过滤条件
     */
    @Column(name = "st_data_filter")
    private String dataFilter;//如果系统无法区分多个同表Model，则需要用此字段存储Model的过滤条件，数据格式举例：{left: "stEmployeeName", operate: "like", right: "asdf"}

    public TreeModel() {
    }

    public TreeModel(String id) {
        super(id);
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public TreeModel getParent() {
        return parent;
    }

    public void setParent(TreeModel parent) {
        this.parent = parent;
    }

    public Integer getTreeNodeTier() {
        return treeNodeTier;
    }

    public void setTreeNodeTier(Integer treeNodeTier) {
        this.treeNodeTier = treeNodeTier;
    }

    public TreeDefinition getTreeDefinition() {
        return treeDefinition;
    }

    public void setTreeDefinition(TreeDefinition treeDefinition) {
        this.treeDefinition = treeDefinition;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getDataFilter() {
        return dataFilter;
    }

    public void setDataFilter(String dataFilter) {
        this.dataFilter = dataFilter;
    }

    public String getTreeTableName() {
        return treeTableName;
    }

    public void setTreeTableName(String treeTableName) {
        this.treeTableName = treeTableName;
    }

    public String getModelCategory() {
        return modelCategory;
    }

    public void setModelCategory(String modelCategory) {
        this.modelCategory = modelCategory;
    }

    public static void main(String[] args) {
        System.out.println(new TreeModel().getFindListSql());
    }
}
